package com.sne.airways.system.service;

import com.sne.airways.basecore.exceptions.AppException;
import com.sne.airways.basecore.service.BaseService;
import com.sne.airways.system.dto.TdOperationCheckDTO;
import com.sne.airways.system.dto.TdOperationDTO;

import java.util.Set;

/**
 * Created by IntelliJ IDEA.
 * User: skyline
 * Date: 12-2-13
 * Time: 下午3:13
 * To change this template use File | Settings | File Templates.
 */
public interface OperationService extends BaseService {
    /**
     * 返回首页需要显示的列表
     * @param operationId
     * @param status
     * @return
     * @throws AppException
     */
    public Set<TdOperationDTO> queryPrivateOperationTree(String operationId, String status) throws AppException;

    /**
     * 根据菜单Id和状态返回菜单列表
     * @param operationId
     * @param status
     * @return
     * @throws AppException
     */
    public Set<TdOperationDTO> queryOperationTree(String operationId, String status) throws AppException;

    /**
     * 保存菜单
     * @param operationId
     * @param parentId
     * @param menuName
     * @param menuView
     * @param menuController
     * @param menuIndex
     * @param menuLevel
     * @param version
     * @param status
     * @param iconCls
     * @param expandedCls
     * @param collapsedCls
     * @return
     * @throws AppException
     */
    public TdOperationDTO saveOperation(String operationId, String parentId, String menuName, String menuView,String menuController,
                                        int menuIndex, int menuLevel, int version, String status,String iconCls,String expandedCls,String collapsedCls) throws AppException;

    /**
     * 更新菜单
     * @param operationId
     * @param parentId
     * @param menuName
     * @param menuView
     * @param menuController
     * @param menuIndex
     * @param menuLevel
     * @param version
     * @param status
     * @param iconCls
     * @param expendedCls
     * @param collapsedCls
     * @return
     * @throws AppException
     */
    public TdOperationDTO updateOperation(String operationId, String parentId, String menuName, String menuView,String menuController,
                                     int menuIndex, int menuLevel, int version, String status,String iconCls,String expendedCls,String collapsedCls) throws AppException;

    /**
     * 删除菜单
     * @param operationId
     * @param version
     * @return
     * @throws AppException
     */
    public void deleteOperation(String operationId, int version) throws AppException;

    /**
     * 修改菜单排序
     * @param operationId
     * @param parentId
     * @param oldParentId
     * @param menuIndex
     * @param oldMenuIndex
     * @param menuLevel
     * @param oldMenuLevel
     * @param version
     * @throws AppException
     */
    public void changeOperationIndex(String operationId, String parentId, int menuIndex,
                                     int menuLevel, String oldParentId,int oldMenuIndex,  int oldMenuLevel, int version) throws AppException;
    /**
     * 根据菜单Id和状态返回菜单列表
     * @param operationId
     * @param roleId
     * @param status
     * @return
     * @throws AppException
     */
    public Set<TdOperationCheckDTO> queryOperationCheckedTree(String operationId,String roleId, String status) throws AppException;
}
